package com.etc.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.SystemPropertyUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.etc.entity.Administer;
import com.etc.service.AdministerService;

@Controller
public class AdministerController {

	@Resource
	private AdministerService administerService;

	@RequestMapping(value = "login", method = RequestMethod.GET)
	public ModelAndView getAdmin(String adminName, String adminPwd) {
        
		
		Administer admin = administerService.selectAdmin(adminName, adminPwd);
		ModelAndView mv = new ModelAndView("back/index");
		//System.out.println(admin);
		mv.addObject("adminName", admin.getAdminname());
		
		return mv;
	}

}
